import axios from '@/request/http'

import { commonOutDTO, pageCommonInputDTO, pageCommonOutDTO } from '@/api/common.d'
import {
  SsdaListQueryParam,
  SsdaListQueryResult,
  SsdawsGetInputDTO,
  SsdawsGetOutputDTO,
  SpdaListQueryParam,
  SpdaListQueryResult,
  JydListQueryParam,
  JydListQueryResult,
  JyqsajmlListQueryParam,
  JyqsajmlListQueryResult,
  JysqajxxlbQueryParam,
  JysqajxxlbQueryResult,
  JysqspdalbQueryParam,
  JysqspdalbQueryResult,
  JycajsjQueryResult,
  JycajwsmlsjQueryResult,
  JycspsjlbQueryResult,
  JycjlDelInputDTO,
  JycjlAddInputDTO,
  JycjlAddOutputDTO,
  JysqSaveInputDTO,
  JysqSaveOutputDTO,
  JylcCreateInputDTO,
  JylcCreateOutputDTO,
  JysqRecallInputDTO,
  JysqRecallOutputDTO,
  DdsjSaveInputDTO,
  DdsjSaveOutputDTO,
  JyspdspListQueryParam,
  JyspdspListQueryResult,
  JyspyspListQueryParam,
  JyspyspListQueryResult,
  JyShjgSaveInputDTO,
  JyShjgSaveOutputDTO,
  JysqjcrqSaveInputDTO,
  JysqjcrqSaveOutputDTO,
  JysqghrqSaveInputDTO,
  JysqghrqSaveOutputDTO,
  DasfkyckGetInputDTO,
  DasfkyckGetOutputDTO,
  JyglListQueryParam,
  JyglListQueryResult,
  JydwjGetInputDTO,
  JydwjGetOutputDTO,
  JylcgzlbQueryParam,
  JylcgzlbQueryResult,
  JysqdInputDTO,
  JysqdOutputDTO,
  JysqxqInputDTO,
  JysqxqOutputDTO,
  JyshlcOutputDTO,
  DownAjZipQueryParam,
} from '@/api/jygl-dto'

export default class jyglService {
  /**
   * 获取诉讼档案列表
   */
  static querySsdaList(
    data: pageCommonInputDTO<SsdaListQueryParam | SpdaListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<SsdaListQueryResult[]>>> {
    return axios.post('/api/jygl/querySsdaList', data)
  }
  /**
   * 获取借阅申请详情
   */
  static getJysqxq(data: JysqxqInputDTO): Promise<commonOutDTO<JysqxqOutputDTO>> {
    return axios.post('/api/jygl/getJysqxq', data)
  }
  /**
   * 获取借阅申请审核流程
   */
  static queryJyshlc(data: JysqxqInputDTO): Promise<commonOutDTO<JyshlcOutputDTO>> {
    return axios.post('/api/jygl/queryJyshlc', data)
  }
  /**
   * 获取归档案卷文书
   */
  static getSsdaws(data: SsdawsGetInputDTO): Promise<commonOutDTO<SsdawsGetOutputDTO[]>> {
    return axios.post('/api/jygl/getSsdaws', data)
  }
  /**
   * 获取视频档案列表
   */
  static querySpdaList(
    data: pageCommonInputDTO<SpdaListQueryParam | SsdaListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<SpdaListQueryResult[]>>> {
    return axios.post('/api/jygl/querySpdaList', data)
  }
  /**
   * 我的借阅单分页列表
   */
  static queryJydList(
    data: pageCommonInputDTO<JydListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<JydListQueryResult[]>>> {
    return axios.post('/api/jygl/queryJydList', data)
  }
  /**
   * 借阅-案件诉讼文书树
   */
  // JyqsajmlListQueryResult[]
  static queryJyqsajmlList(data: JyqsajmlListQueryParam): Promise<commonOutDTO<any[]>> {
    return axios.post('/api/jygl/queryJyqsajmlList', data)
  }
  /**
   * 借阅申请-案件信息列表
   */
  static queryJysqajxxlb(
    data: JysqajxxlbQueryParam,
  ): Promise<commonOutDTO<JysqajxxlbQueryResult[]>> {
    return axios.post('/api/jygl/queryJysqajxxlb', data)
  }
  /**
   * 借阅申请-视频档案列表查询
   */
  static queryJysqspdalb(
    data: JysqspdalbQueryParam,
  ): Promise<commonOutDTO<JysqspdalbQueryResult[]>> {
    return axios.post('/api/jygl/queryJysqspdalb', data)
  }
  /**
   * 借阅车-案件数据列表
   */
  static queryJycajsj(): Promise<commonOutDTO<JycajsjQueryResult>> {
    return axios.post('/api/jygl/queryJycajsj')
  }
  /**
   * 借阅车-案卷文书目录树
   */
  static queryJycajwsmlsj(data: any): Promise<commonOutDTO<JycajwsmlsjQueryResult[]>> {
    return axios.post('/api/jygl/queryJycajwsmlsj', data)
  }
  /**
   * 借阅车-视频数据列表
   */
  static queryJycspsjlb(): Promise<commonOutDTO<JycspsjlbQueryResult[]>> {
    return axios.post('/api/jygl/queryJycspsjlb')
  }
  /**
   * 借阅车-移除数据
   */ //JycjlDelInputDTO
  static delJycjl(data: any): Promise<commonOutDTO<boolean>> {
    return axios.post('/api/jygl/delJycjl', data)
  }
  /**
   * 借阅车-添加数据
   */ //JycjlAddInputDTO
  static addJycjl(data: any): Promise<commonOutDTO<JycjlAddOutputDTO>> {
    return axios.post('/api/jygl/addJycjl', data)
  }
  /**
   * 借阅-添加借阅申请
   */ //JysqSaveInputDTO
  static saveJysq(data: any): Promise<commonOutDTO<JysqSaveOutputDTO>> {
    return axios.post('/api/jygl/saveJysq', data)
  }
  /**
   * 借阅-发起借阅申请流程
   */
  static createJylc(data: JylcCreateInputDTO): Promise<commonOutDTO<JylcCreateOutputDTO>> {
    return axios.post('/api/jygl/createJylc', data)
  }
  /**
   * 借阅-撤回借阅申请流程
   */
  static recallJysq(data: JysqRecallInputDTO): Promise<commonOutDTO<JysqRecallOutputDTO>> {
    return axios.post('/api/jygl/recallJysq', data)
  }
  /**
   * 借阅-保存调档数据
   */
  static saveDdsj(data: DdsjSaveInputDTO): Promise<commonOutDTO<DdsjSaveOutputDTO>> {
    return axios.post('/api/jygl/saveDdsj', data)
  }
  /**
   * 借阅-获取借阅申请单
   */
  static getJysqd(data: JysqdInputDTO): Promise<commonOutDTO<JysqdOutputDTO>> {
    return axios.post('/api/jygl/getJysqd', data)
  }
  /**
   * 借阅审批-待审批
   */
  static queryJyspdspList(
    data: pageCommonInputDTO<JyspdspListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<JyspdspListQueryResult[]>>> {
    return axios.post('/api/jygl/queryJyspdspList', data)
  }
  /**
   * 借阅审批-待审批
   */
  static queryJyspyspList(
    data: pageCommonInputDTO<JyspyspListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<JyspyspListQueryResult[]>>> {
    return axios.post('/api/jygl/queryJyspyspList', data)
  }
  /**
   * 保存借阅审核结果
   */
  static saveJyShjg(data: JyShjgSaveInputDTO): Promise<commonOutDTO<JyShjgSaveOutputDTO>> {
    return axios.post('/api/jygl/saveJyShjg', data)
  }
  /**
   * 保存档案借出时间
   */
  static saveJysqjcrq(data: JysqjcrqSaveInputDTO): Promise<commonOutDTO<JysqjcrqSaveOutputDTO>> {
    return axios.post('/api/jygl/saveJysqjcrq', data)
  }
  /**
   * 保存档案归还时间
   */
  static saveJysqghrq(data: JysqghrqSaveInputDTO): Promise<commonOutDTO<JysqghrqSaveOutputDTO>> {
    return axios.post('/api/jygl/saveJysqghrq', data)
  }
  /**
   * 获取档案是否能查看
   */
  static getDasfkyck(data: DasfkyckGetInputDTO): Promise<commonOutDTO<DasfkyckGetOutputDTO>> {
    return axios.post('/api/jygl/getDasfkyck', data)
  }
  /**
   * 借阅管理分页列表
   */
  static queryJyglList(
    data: pageCommonInputDTO<JyglListQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<JyglListQueryResult[]>>> {
    return axios.post('/api/jygl/queryJyglList', data)
  }
  /**
   * 获取借阅单文件
   */
  static getJydwj(data: JydwjGetInputDTO): Promise<any> {
    return axios.get(`/api/jygl/getJydwj?jysqbh=${data.jysqbh}`, {
      responseType: 'blob',
    })
  }
  /**
   * 查询借阅流程跟踪列表
   */
  static queryJylcgzlb(data: JylcgzlbQueryParam): Promise<commonOutDTO<JylcgzlbQueryResult>> {
    return axios.post('/api/jygl/queryJylcgzlb', data)
  }
  /**
   * 借阅-下载案卷压缩包
   */
  static downAjZip(data: DownAjZipQueryParam): Promise<commonOutDTO<JylcgzlbQueryResult>> {
    return axios.post('/api/jygl/downAjZip', data, { responseType: 'blob' })
  }
  /**
   * 借阅申请-获取借阅单号
   */
  static getJydbh(data: any): Promise<commonOutDTO<any>> {
    return axios.post('/api/jygl/getJydbh', data)
  }
}
